//
//  rightSubDetailView.m
//  dataGathering
//
//  Created by apple on 14-11-5.
//  Copyright (c) 2014年 shuili. All rights reserved.
//

#import "rightSubDetailView.h"

#import "currentWorkSetManager.h"

@interface rightSubDetailView ()
@property (weak, nonatomic) IBOutlet UILabel *worksetNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *creatorAndDateLabel;

@end

@implementation rightSubDetailView

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setCurrentWorkSetLabels];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setCurrentWorkSetLabels) name:@"updateSelectedWorkSet" object:nil];
    // Do any additional setup after loading the view.
}

- (void)setCurrentWorkSetLabels
{
    currentWorkSetManager *manager = [currentWorkSetManager sharedInstance];
    workSet *currentWorkSet = [manager getCurrentWorkSet];
    [_worksetNameLabel setText:[currentWorkSet name]];
    [_creatorAndDateLabel setText:[currentWorkSet creator]];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)removeAdditionalView
{
    UINavigationController *naviVC = (UINavigationController*)[[self childViewControllers] objectAtIndex:0];
    [naviVC popToRootViewControllerAnimated:YES];
    
    NSLog(@"rhere are %lu controllers",(unsigned long)[[naviVC viewControllers] count]);

}


#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{

}


@end
